package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiMplsQoslevelMapper;
import com.ruoyi.net.domain.ElementBusiMplsQoslevel;
import com.ruoyi.net.service.IElementBusiMplsQoslevelService;

/**
 * 网元-业务-mpls-qos上下话优先级Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiMplsQoslevelServiceImpl implements IElementBusiMplsQoslevelService 
{
    @Autowired
    private ElementBusiMplsQoslevelMapper elementBusiMplsQoslevelMapper;

    /**
     * 查询网元-业务-mpls-qos上下话优先级
     * 
     * @param id 网元-业务-mpls-qos上下话优先级主键
     * @return 网元-业务-mpls-qos上下话优先级
     */
    @Override
    public ElementBusiMplsQoslevel selectElementBusiMplsQoslevelById(String id)
    {
        return elementBusiMplsQoslevelMapper.selectElementBusiMplsQoslevelById(id);
    }

    /**
     * 查询网元-业务-mpls-qos上下话优先级列表
     * 
     * @param elementBusiMplsQoslevel 网元-业务-mpls-qos上下话优先级
     * @return 网元-业务-mpls-qos上下话优先级
     */
    @Override
    public List<ElementBusiMplsQoslevel> selectElementBusiMplsQoslevelList(ElementBusiMplsQoslevel elementBusiMplsQoslevel)
    {
        return elementBusiMplsQoslevelMapper.selectElementBusiMplsQoslevelList(elementBusiMplsQoslevel);
    }

    /**
     * 新增网元-业务-mpls-qos上下话优先级
     * 
     * @param elementBusiMplsQoslevel 网元-业务-mpls-qos上下话优先级
     * @return 结果
     */
    @Override
    public int insertElementBusiMplsQoslevel(ElementBusiMplsQoslevel elementBusiMplsQoslevel)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiMplsQoslevel.getId())) {
            elementBusiMplsQoslevel.setId(uuid);
        }
        elementBusiMplsQoslevel.setCreateBy(SecurityUtils.getUsername());
        elementBusiMplsQoslevel.setCreateTime(DateUtils.getNowDate());
        elementBusiMplsQoslevel.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMplsQoslevel.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMplsQoslevelMapper.insertElementBusiMplsQoslevel(elementBusiMplsQoslevel);
    }

    /**
     * 修改网元-业务-mpls-qos上下话优先级
     * 
     * @param elementBusiMplsQoslevel 网元-业务-mpls-qos上下话优先级
     * @return 结果
     */
    @Override
    public int updateElementBusiMplsQoslevel(ElementBusiMplsQoslevel elementBusiMplsQoslevel)
    {
        elementBusiMplsQoslevel.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMplsQoslevel.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMplsQoslevelMapper.updateElementBusiMplsQoslevel(elementBusiMplsQoslevel);
    }

    /**
     * 批量删除网元-业务-mpls-qos上下话优先级
     * 
     * @param ids 需要删除的网元-业务-mpls-qos上下话优先级主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMplsQoslevelByIds(String[] ids)
    {
        return elementBusiMplsQoslevelMapper.deleteElementBusiMplsQoslevelByIds(ids);
    }

    /**
     * 删除网元-业务-mpls-qos上下话优先级信息
     * 
     * @param id 网元-业务-mpls-qos上下话优先级主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMplsQoslevelById(String id)
    {
        return elementBusiMplsQoslevelMapper.deleteElementBusiMplsQoslevelById(id);
    }
}
